package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.entity.DishFlavor;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 老杨
 * @version 1.0
 *
 */
@Mapper
public interface DishFlavorMapper {


    /**
     * 添加 多条口味
     */

    void addList(List<DishFlavor> flavors);

    /**
     * 根据 菜品 id 返回 对应口味
     * @param id
     * @return
     */
    @Select("select * from dish_flavor where dish_id = #{id}")
    List<DishFlavor> getById(Long id);

    /**
     * 根据 dishId 删除单个
     * @param id
     */
    @Delete("delete from dish_flavor where dish_id = #{id}")
    void delete(Long id);

    /**
     * 根据 dishId 删除多个
     * @param ids
     */
    void deletes(List<Long> ids);
}

